#include<iostream>
int main()
{
	int a, b;
	std::cin >> a >> b;
	int c[10000], d[10000],max,max_s=0,max_e=0;
	int temp;
	for (int i = 0; i < a; i++)
	{
		std::cin >> temp;
		c[i] = temp;
	}
	d[0] = c[0];
	max = c[0];
	for (int i = 1; i < a; i++)
	{
		d[i] = d[i - 1] + c[i];
	}
	for (int i = 0; i < a - b; i++)
	{
		if (d[i + b] - d[i] > max)
		{
			if (i != 0)
			{
				max = d[i + b - 1] - d[i - 1];
				max_s = i + 1;
				max_e = i + 3;
			}
			else
			{
				max = d[i + b - 1];
				max_s = i + 1;
				max_e = i + 3;
			}
		 }
	}
	std::cout << max << "\n" << max_s << " " << max_e;

}